package com.coderman.common.starter.tianqing.qlexpress.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Description:
 * date: 2020/10/14
 *
 * @author fanchunshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class QlScriptRunnerImpl implements QlScriptRunner{
    @Resource(name = "springQlExpressRunner")
    private SpringQlExpressRunner springQlExpressRunner;

    @Autowired
    private QlExpressDataHelperService qlExpressDataHelperService;

    @Override
    public Object exeQlExpress(String dataId, String groupId, Map<String, Object> context) {
        String qlContent = qlExpressDataHelperService.getConfig(dataId, groupId);
        return springQlExpressRunner.executeExpress(qlContent,context);
    }
}
